import 'package:flutter/material.dart';
import 'package:flutter_jd/tools/data/mock.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
import 'package:get/get_state_manager/get_state_manager.dart';
import 'package:get/get.dart';

class OrderController extends GetxController with SingleGetTickerProviderMixin {
  OrderController({required this.initTabIndex});
  final int initTabIndex;

  List tabs = ['全部', '待付款', '待收货', '已完成', '已取消'];
  List tabsStatus = [
    {'status': 'accept', 'index': 0},
    {'status': 'check', 'index': 1},
    {'status': 'checked', 'index': 2},
    {'status': 'checked', 'index': 3},
    {'status': 'checked', 'index': 4},
  ];
  final SlidableController slidableController = SlidableController();
  bool isSelectAll = false;
  double totalPrice = 0;
  int selectedNumber = 0;
  List productList = cartProductList;
  late TabController tabController;

  @override
  void onInit() {
    super.onInit();

    tabController = TabController(
      length: tabs.length,
      vsync: this,
      initialIndex: initTabIndex,
    );
  }

  @override
  void onClose() {
    tabController.dispose();
    super.onClose();
  }
}
